from django.urls import path, re_path
from . import views
from rest_framework_simplejwt.views import TokenRefreshView

urlpatterns = [
    # 登录，获取JWT Token
    path('login/', views.CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),
    # 刷新JWT Token，发送POST请求，包含 refresh token，如果有效，返回access token,refresh token
    path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),

    # 查询手机号是否被注册
    re_path(r"^mobile/(?P<mobile>1[3-9]\d{9})/$", views.MobileAPIView.as_view()),
    # 用户注册
    path('register/', views.UserRegistrationView.as_view(), name='register'),
    # 发送短信验证码
    re_path(r"^sms/(?P<mobile>1[3-9]\d{9})/$", views.SMSAPIView.as_view()),

]
